package com.jzo2o.market.controller.consumer;

import com.jzo2o.market.model.dto.request.SeizeCouponReqDTO;
import com.jzo2o.market.model.dto.response.CouponInfoResDTO;
import com.jzo2o.market.service.ICouponService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * TODO
 *
 * @Author lyh
 * @Date 2024/12/14 22:10
 */
@RestController("consumerCouponController")
@RequestMapping("/consumer/coupon")
@Api(tags = "用户端 - 优惠券活动领取相关接口")
public class CouponController {
    @Autowired
    private ICouponService couponService;
    @GetMapping("/my")
    public List<CouponInfoResDTO> myCoupon(Integer status,Long lastId){
      return couponService.myCoupon(status,lastId);
    }
    @PostMapping("/seize")
    public void seizeCoupon(@RequestBody SeizeCouponReqDTO seizeCouponReqDTO) {
       couponService.seizeCoupon(seizeCouponReqDTO);
    }
}
